package com.kaifamiao.handle;

public class HandleTest8 {

	@SuppressWarnings({ "unused", "null" })
	public static void main(String[] args) {
		
		int[] array = new int[0];
		System.out.println( array.length );
		
		Object x = null ;
		
		try {
			//System.out.println( 100 / 0 ); // ArithmeticException
			//System.out.println( array[ 250 ] ); // IndexOutOfBoundsException
			System.out.println( x.toString() );
		} catch( ArithmeticException e ) {
			System.out.println( "算术异常: " + e.getMessage() );
		} catch( IndexOutOfBoundsException e ) {
			System.out.println( "下标越界异常: " + e.getMessage() );
		} catch( Exception e ) {
			System.out.println( "异常: " + e.getMessage() );
		} 
		
	}

}
